<!doctype html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>备忘录</title>
	<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
	<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
	<!-- CSS overrides - remove if you don't need it -->
	<link rel="stylesheet" href="css/app.css">
</head>

<body>
	<!-- 2.设置挂载点 -->
	<section class="todoapp" id="app">
		<header class="header">
			<h1>我的备忘录</h1>
			<!-- 6.绑定键盘事件,按下回车就可以添加新的任务列表 -->
			<input class="new-todo" placeholder="今天你有什么计划?" autofocus v-model="content" @keyup.13="addTask" v-focus>
		</header>
		<!-- This section should be hidden by default and shown when there are todos -->
		<section class="main">
			<input id="toggle-all" class="toggle-all" type="checkbox" v-model="checkall">
			<label for="toggle-all">Mark all as complete</label>
			<ul class="todo-list">
				<!-- These are here just to show the structure of the list items -->
				<!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
				<!-- <li class="editing">
					<div class="view">
						<input class="toggle" type="checkbox" checked>
						<label>Taste JavaScript</label>
						<button class="destroy"></button>
					</div>
					<input class="edit" value="Create a TodoMVC template">
				</li> -->
				<!-- 4.进行数据渲染，v-for循环生成数据 -->
				<li v-for="(item, index) in taskFilter" :class="{completed:item.isDone,editing:currenIndex==index}"
					@dblclick="edit(index)">
					<div class="view">
						<input class="toggle" type="checkbox" v-model="item.isDone">
						<label>{{ item.title }}</label>
						<!-- 5.绑定点击事件,点击能够删除一行数据 -->
						<button class="destroy" @click="del(index)"></button>
					</div>
					<input class="edit" value="Rule the web" v-model="item.title " @blur="keepItem(index)"
						@keyup.13="$event.target.blur" v-focus2>
				</li>
			</ul>
		</section>
		<!-- This footer should be hidden by default and shown when there are todos -->
		<footer class="footer">
			<!-- This should be `0 items left` by default -->
			<span class="todo-count"><strong>{{total}}</strong> item left</span>
			<!-- Remove this if you don't implement routing -->
			<ul class="filters">
				<li>
					<a :class="{selected:hash=='all'}" href="#/all">All</a>
				</li>
				<li>
					<a :class="{selected:hash=='active'}" href="#/active">Active</a>
				</li>
				<li>
					<a :class="{selected:hash=='completed'}" href="#/completed">Completed</a>
				</li>
			</ul>
			<!-- Hidden if no completed items are left ↓ -->
			<button class="clear-completed" @click="delAll">Clear completed</button>
		</footer>
	</section>

	<!-- Scripts here. Don't remove ↓ -->
	<script src="node_modules/todomvc-common/base.js"></script>
	<!-- 1.引入vue框架，一定是在app.js之前 -->
	<script src="./js/vue.js"></script>
	<script src="js/app.js"></script>
</body>

</html>